<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>插入代码</title>
<link href="../../../data/images/css.css" rel="stylesheet" type="text/css">
<head>
</head>
<body>
<script>
function SetPicOk(ecms){
	var bordercolor=document.insertpic.bordercolor.value;
	var bgcolor=document.insertpic.bgcolor.value;
	var codetext="&nbsp;";
	var imgstr="";
	imgstr="<table border=0 width='100%' cellspacing=1 cellpadding=10 bgcolor='"+bgcolor+"'><tr><td width='100%' bgcolor='"+bordercolor+"' style='word-break:break-all;line-height:18px'>"+codetext+"</td></tr></table>";
	if(ecms==0)
	{
		window.viewpic.innerHTML=imgstr;
	}
	else
	{
		window.returnValue=imgstr;
		window.close();
	}
}

//格式化html
function RepHtml(str)
{
	str=str.replace("<","&lt;");
	str=str.replace(">","&gt;");
	str=str.replace("&","&amp;");
	str=str.replace("\"","&quot;");
	str=str.replace("\n","<br>");
	str=str.replace(" ","&nbsp;");
	return str;
}

function foreColor(formobj)
{
  if (!Error())	return;
  var arr = showModalDialog("../selcolor.html", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0");
  if (arr != null) {
  	if(formobj==0){
  		document.insertpic.bgcolor.value=arr;
	}
	else{
		document.insertpic.bordercolor.value=arr;
	}
  }
  else {
  	if(formobj==0){
  		document.insertpic.bgcolor.focus();
	}
	else{
		document.insertpic.bordercolor.focus();
	}
  }
}
</script>
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  <form name="insertpic" method="post" action="">
    <tr class="header"> 
      <td height="23">设置插入代码</td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#FFFFFF"> <div align="left">背景颜色 
          <input name="bordercolor" type=text id="bordercolor" value="#DDEDFB" size="8">
          <a onclick="foreColor(1);"><img src="../../../data/images/color.gif" width="21" height="21" align="absbottom"></a> 
          边框颜色
<input name="bgcolor" type=text id="bgcolor" value="#0099CC" size="8">
          <a onclick="foreColor(0);"><img src="../../../data/images/color.gif" width="21" height="21" align="absbottom"></a> 
          <input type="button" name="Submit" value="插入" onclick="SetPicOk(1);">
          <input type="button" name="Submit2" value="取消" onclick="window.close();">
        </div></td>
    </tr>
  </form>
</table>
</body>
</html>